package com.example.mydy.withdraw;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;

/**
 * 提现步骤ViewPager适配器
 */
public class WithdrawPagerAdapter extends FragmentStateAdapter {
    
    private static final int NUM_PAGES = 4;
    
    public WithdrawPagerAdapter(@NonNull FragmentActivity fragmentActivity) {
        super(fragmentActivity);
    }
    
    @NonNull
    @Override
    public Fragment createFragment(int position) {
        // 根据位置返回对应的Fragment
        switch (position) {
            case 0:
                return new WithdrawStep1Fragment();
            case 1:
                return new WithdrawStep2Fragment();
            case 2:
                return new WithdrawStep3Fragment();
            case 3:
                return new WithdrawStep4Fragment();
            default:
                return new WithdrawStep1Fragment();
        }
    }
    
    @Override
    public int getItemCount() {
        return NUM_PAGES;
    }
} 